home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Internet Info 1994 March
/
Internet Info CD-ROM (Walnut Creek) (March 1994).iso
/
networking
/
cisco
/
cisco-expect.shar
/
cleanconfig
< prev
Wrap
Text File
|
1992-08-07
|
546b
|
28 lines
#!/usr/bin/perl
$file = $ARGV[0];
$newfile = $file . ".new";
die "No file specified\n" unless $file;
open(CFG, "<$file") || die "Can't open $file\n";
open(NEWCFG, ">$newfile") || die "Can't open $newfile\n";
print NEWCFG <<"EOM";
!
! Note: this file ($file) has had the passwords removed for
! security reasons.
!
EOM
while (<CFG>) {
if (/^(enable-password|password)\s+/) {
print NEWCFG "! $1 CENSORED\n";
next;
}
print NEWCFG;
}
close(CFG);
close(NEWCFG);
rename($newfile, $file) || die "Can't rename $newfile to $file: $!\n";